<template>
	<div class="fd">
		<div class="box" v-html="message"></div>
	</div>
</template>
<script>
	import {
		mapGetters
	} from 'vuex'
	export default {
		data() {
			return {
				message: ''
			};
		},

		computed: {
			...mapGetters([
				'details'
			])
		},
		created() {
			let id = this.$route.query.id
			console.log(id)
			this.$store.dispatch("vuexDetail", id)
				.then(e => {
					console.log(e)
					this.images = e.data.data.imgList
					this.lists = e.data.data
					this.message = e.data.data.goods_content
					this.click1()
				})
		},
		methods: {
			click1() {
				this.message = this.escapeHtml(this.message)
			},
			escapeHtml(str) {
				var arrEntities = {
					'lt': '<',
					'gt': '>',
					'nbsp': ' ',
					'amp': '&',
					'quot': '"'
				};
				return str.replace(/&(lt|gt|nbsp|amp|quot);/ig, function(all, t) {
					return arrEntities[t];
				});
			},

		}
	};
</script>

<style>
	.fd {
		font-size: 0.3rem;
		text-align: left;
	}

	.fd img {
		width: 100%;

	}
</style>
